package org.zero.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.zero.exception.SysException;

/**
 * @author Zero
 */
@Controller
public class HelloController {
    @RequestMapping("hello")
    public String sayHello() {
        try {
            //模拟服务器内部发生错误
            int i = 1 / 0;
        } catch (Exception e) {
            e.printStackTrace();
            throw new SysException("请求hello服务错误", e);
        }
        return "success";
    }
}
